package com.powernode.spring6.autowired.service;
import com.powernode.spring6.autowired.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

@Service
public class UserService {
//    @Autowired
//    @Qualifier(value = "userDaoForMySQL")
    private UserDao userDao;

//    public UserService(@Autowired @Qualifier(value = "userDaoForMySQL") UserDao userDao) {
//        this.userDao = userDao;
//    }

    public UserService(UserDao userDao) {
        this.userDao = userDao;
    }


    //    @Autowired
//    @Qualifier(value = "userDaoForMySQL")
//    public void setUserDao(UserDao userDao) {
//        this.userDao = userDao;
//    }

    public void save(){
        userDao.insert();
    }
}
